package com.share.dao.sysmgr.privilege;

import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.sysmgr.privilege.PrivilegeResource;
import com.share.commons.base.dao.BaseDaoSupport;


@Component("privilegeResourceDao")
public class PrivilegeResourceDaoImpl extends BaseDaoSupport<PrivilegeResource> implements PrivilegeResourceDao{

	@Override
	public void deleteResourceDao(int id) throws RuntimeException {
		
		this.deleteObject(this.queryByIdResourceDao(id)) ;
	}

	@Override
	public PrivilegeResource queryByIdResourceDao(int id) throws RuntimeException {
		
		return (PrivilegeResource) this.getById(PrivilegeResource.class, id) ;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PrivilegeResource> queryResourceDao(String hql)
			throws RuntimeException {
		return (List<PrivilegeResource>) this.find(hql) ;
	}

	@Override
	public void saveResourceDao(PrivilegeResource res) throws RuntimeException {
		
		this.saveObject(res) ;
	}

	@Override
	public void updateResourceDao(PrivilegeResource res) throws RuntimeException {
		this.updateObject(res) ;
	}


}
